//
//  PersonalFriendListCell.m
//  WEIMO
//
//  Created by Lixiaoyong on 13-6-24.
//  Copyright (c) 2013年 广州从兴电子开发有限公司. All rights reserved.
//

#import "PersonalFriendListCell.h"

#import <QuartzCore/QuartzCore.h>

#define kClearColor [UIColor clearColor]

@implementation PersonalFriendListCell
@synthesize headerImage;
@synthesize modeName,dateTime,messages;

- (void)dealloc
{
    self.headerImage = nil;
    self.modeName = nil;
    self.dateTime = nil;
    self.messages = nil;
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.backgroundView = [[[UIView alloc] initWithFrame:self.frame] autorelease];
        self.backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"hengtiao.png"]];
        self.selectedBackgroundView = [[[UIView alloc] initWithFrame:self.frame] autorelease];
        self.selectedBackgroundView.backgroundColor = kClearColor;
        
        CGRect rect = CGRectMake(5, 6.5, 48, 48);
        self.headerImage = [[[UIImageView alloc] initWithFrame:rect] autorelease];
        self.headerImage.backgroundColor = kClearColor;
        self.headerImage.layer.masksToBounds = YES;
        self.headerImage.layer.cornerRadius = 8.0;
        self.headerImage.layer.borderColor = [UIColor whiteColor].CGColor;
        self.headerImage.layer.borderWidth = 1.0;
        self.headerImage.contentMode = UIViewContentModeScaleAspectFit;
        [self addSubview:self.headerImage];
        
        rect = CGRectMake(60, 0, 100, 30);
        self.modeName = [[[UILabel alloc] initWithFrame:rect] autorelease];
        self.modeName.backgroundColor = kClearColor;
        self.modeName.textColor = [UIColor blackColor];
        [self addSubview:self.modeName];
        
        rect.origin.x = rect.origin.x + rect.size.width;
        rect.size.width = self.frame.size.width - rect.origin.x - 5;
        self.dateTime = [[[UILabel alloc] initWithFrame:rect] autorelease];
        self.dateTime.backgroundColor = kClearColor;
        self.dateTime.textColor = [UIColor grayColor];
        self.dateTime.textAlignment = NSTextAlignmentRight;
        [self addSubview:self.dateTime];
        
        rect.origin.y = rect.origin.y + rect.size.height;
        rect = CGRectMake(60, rect.origin.y, self.frame.size.width - 100, 30);
        self.messages = [[[UILabel alloc] initWithFrame:rect] autorelease];
        self.messages.backgroundColor = kClearColor;
        self.messages.textColor = [UIColor grayColor];
        [self addSubview:self.messages];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

@end